package com.zt.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zt.feign.UserFeign;
import com.zt.system.PersonalCenter;
import com.zt.service.PersonalCenterService;
import com.zt.mapper.PersonalCenterMapper;
import com.zt.user.UserInfo;
import com.zt.utils.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 不.凌
* @description 针对表【personal_center】的数据库操作Service实现
* @createDate 2024-09-03 17:43:26
*/
@Service
public class PersonalCenterServiceImpl extends ServiceImpl<PersonalCenterMapper, PersonalCenter>
    implements PersonalCenterService{
    @Resource
    private UserFeign userFeign;
    @Override
    public Result personalCenterList() {
        List<PersonalCenter> list = this.list();
        for(PersonalCenter personalCenter: list){
            UserInfo userInfoById = userFeign.getUserInfoById(personalCenter.getUserId());
            personalCenter.setUserInfo(userInfoById);
        }
        return Result.success(list);
    }
}




